
	b reset
	b undefined 
	b swi
	b pre_abt
	b data_abt
	mov r0, r0
	b irq
	b fiq
	
reset:
	mov sp, #0x56000000
	mov ip, sp
	stmfd sp!, {r0-r12, lr}
	sub fp, ip, #4

	mov sp, #0x56000000
	ldmea sp, {r0-r12, pc}^

undefined:
	mov sp, #0x56000000
	mov ip, sp
	stmfd sp!, {r0-r12, lr}
	sub fp, ip, #4

	mov sp, #0x56000000
	ldmea sp, {r0-r12, pc}^

swi:
	mov sp, #0x56000000
	mov ip, sp
	stmfd sp!, {r0-r12, lr}
	sub fp, ip, #4
	
	sub r2, lr, #4
	ldr r1, [r2]
	//r0 = 0xffffff
	ldr r0, =0xffffff
	and r1, r0, r1

	ldr r3, printf
	ldr r0, =str
	blx r3

	mov sp, #0x56000000
	ldmea sp, {r0-r12, pc}^
pre_abt:
	mov sp, #0x56000000
	mov ip, sp
	sub lr, lr, #4
	stmfd sp!, {r0-r12, lr}
	sub fp, ip, #4

	mov sp, #0x56000000
	ldmea sp, {r0-r12, pc}^
data_abt:
	mov sp, #0x56000000
	mov ip, sp
	sub lr, lr, #4
	stmfd sp!, {r0-r12, lr}
	sub fp, ip, #4

	mov sp, #0x56000000
	ldmea sp, {r0-r12, pc}^
irq:
	mov sp, #0x56000000
	mov ip, sp
	sub lr, lr, #4
	stmfd sp!, {r0-r12, lr}
	sub fp, ip, #4
	
//	ldr r2, clean
//	str r0, [r2]
//	
//	ldr r2, wtcon
//	mov r0, #0	
//	str r0, [r2]
//	
//	ldr r0, =str
//	ldr r3, printf
//	blx r3

	mov r3, #0x56000000
	ldr r2, [r3]
	blx r2

	mov sp, #0x56000000
	ldmea sp, {r0-r12, pc}^
fiq:

printf:
	.word 0x57e11d4c
str:
	.asciz "wang wang wang\n"
	.align 2
clean:
	.word 0x7E00400C
wtcon:
	.word 0x7e004000








